package com.fwmagic.dp._2;

public class HumanFactory2 {
    public static <T extends Human> T createHuman(Class<T> clazz) {
        T t = null;
        try {
            t = (T)Class.forName(clazz.getName()).newInstance();
        } catch (Exception e) {
            e.printStackTrace();
            System.err.println("人种生成错误！");
        }
        return t;
    }
}
